<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>处理属性</title>
</head>
<body>
<p id="paragraph1">This is a some text.</p>
<script>
    var pElement = document.getElementById('paragraph1');
    pElement.setAttribute('align', 'center');
    alert(pElement.getAttribute('align'));
    pElement.removeAttribute('align');
</script>
</body>
</html>